package com.shycloud.mido.organ.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shycloud.mido.organ.api.dto.TeacherDTO;
import com.shycloud.mido.organ.api.dto.TeacherDetailedDTO;
import com.shycloud.mido.organ.api.entity.TeacherCourseEntity;
import com.shycloud.mido.organ.api.entity.TeacherDetailedEntity;
import com.shycloud.mido.organ.api.vo.OrganVO;
import com.shycloud.mido.organ.api.vo.StudentListVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TeacherDetailedMapper extends BaseMapper<TeacherDetailedEntity> {

    /**
     * 新增教师详情
     *
     * @param teacherDetailedEntity
     */
    void insertTeacher(TeacherDetailedEntity teacherDetailedEntity);

    /**
     * 查询机构教师ID
     *
     * @param memberId
     * @param orgId
     * @return
     */
    String selectIdByMemberId(@Param("memberId") String memberId, @Param("orgId") Integer orgId);

    /**
     * 会员所在机构
     *
     * @param memberId 会员ID
     * @param status   身份 0 学生 1教师
     * @return
     */
    List<OrganVO> organByMemberId(@Param("memberId") String memberId, @Param("status") String status);

    /**
     * @author: Whf
     * @Date: 2019-09-24 18:49:58
     * @Description: 教师列表一览
     */
    IPage<TeacherDetailedDTO> selectTeacherList(Page page, @Param("entity") TeacherDetailedDTO entity);

    /**
     * @author: Whfeng
     * @Date: 2019-09-26 13:09:00
     * @Description: 教师分配学员列表查询
     */
    IPage<TeacherDetailedDTO> selectTeacherStudents(Page page, @Param("entityDTO") TeacherDetailedDTO teacherDetailedDTO);

    /**
     * @author: Whf
     * @Date: 2019-09-27 14:20
     * @Description: 查询教师下的所有科目
     */
    List<TeacherDetailedDTO> selectCourseList(@Param("teacherId") String teacherId);

    /**
     * @author: Whf
     * @Date: 2019-09-27 14:20
     * @Description: 查询教师下的分配学生数量
     */
    String studentCountByTeacherId(@Param("teacherId") String teacherId);

    /**
     * @author: Whfeng
     * @Date: 2019-10-10 14:09
     * @Description: 教师修改时查看详情
     */
    TeacherDetailedDTO selectTeacherDetails(@Param("entity") TeacherDetailedEntity teacherDetailedEntity);

    /**
     * @author: Whf
     * @Date: 2019-10-11 10:25
     * @Description: 教师下拥有的学生列表
     */
    IPage selectTeacherHaveStudentList(Page page, @Param("entity") TeacherDetailedDTO teacherDetailedDTO);

    /**
     * 查询教师列表
     *
     * @param studentId 学生ID
     * @return
     */
    List<TeacherDTO> selectTeacherByStudentId(@Param("studentId") String studentId, @Param("name") String name);

    /**
     * @author: Whf
     * @Date: 2019/10/21 17:35
     * @Description: 查询教师类型
     */
    TeacherDetailedEntity selectTeacherType(@Param("entity") TeacherDetailedEntity entity);

    /**
     * 学生列表
     *
     * @param name      学生姓名或备注名称
     * @param orderType 排序类型
     * @param teacherId 教师ID
     * @return R
     */
    List<StudentListVO> studentList(@Param("name") String name, @Param("orderType") String orderType, @Param("teacherId") String teacherId);

    /**
     * @author: Whf
     * @Date: 2019/10/13 15:53
     * @Description: 查询机构下的所有老师
     */
    List<TeacherDetailedEntity> orgteacherList(@Param("entity") TeacherDetailedEntity entity);

    /**
     * @author: Whf
     * @Date: 2019/10/30 20:44
     * @Description: 教师授课科目
     */
    List<TeacherCourseEntity> selectTeacherCourseByTeacherId(@Param("teacherId") String teacherId);
}
